package com.app.ytong.manager;

import android.os.Build;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.RequiresApi;

import com.app.ytong.R;
import com.app.ytong.basis.BasisActivity;
import com.app.ytong.bean.LoginBean;
import com.app.ytong.bean.MenuBean;
import com.app.ytong.manager.in.PutInActivity;
import com.app.ytong.manager.qing.ScaleActivity;
import com.app.ytong.util.MyUtils;
import com.qmuiteam.qmui.util.QMUIStatusBarHelper;

import butterknife.OnClick;
import my.ActivityTool;

/**
 * 入库管理-出入存
 */
public class PutTabActivity extends BasisActivity {



    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    public void initViews() {
        setContentView(R.layout.put_tab_activity);
        setTitleBg(R.color.transparent);
        setTitle("出入存管理");
        setTitleLeftButton(null);

    }

    @Override
    public void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        setTitleBg(R.color.transparent);
//        QMUIStatusBarHelper.translucent(mContext);
        QMUIStatusBarHelper.setStatusBarDarkMode(mContext);
    }


    @OnClick({R.id.view_out,R.id.view_in,R.id.view_check})
    public void btnClick(View v){

        switch (v.getId()){
            case R.id.view_out:
                MyUtils.putTabSelectName("出库");
                ActivityTool.skipActivity(mContext, PutInActivity.class);
                break;
            case R.id.view_in:
                MyUtils.putTabSelectName("入库");
                if(MyUtils.getHomeSelectName().contains("茶青")){
                    MenuBean menuData = LoginBean.getInstance().getRightById(MyUtils.getHomeSelectId()).getChildBySelectName();
                    if(menuData == null) return;
                    MyUtils.putTabSelectId(menuData.getId());
                    MyUtils.putTabSelectName(menuData.getSna());
                    ActivityTool.skipActivity(mContext, ScaleActivity.class);
                }else {
                    ActivityTool.skipActivity(mContext, PutInActivity.class);
                }
                break;
            case R.id.view_check:
                MyUtils.putTabSelectName("库存");
                ActivityTool.skipActivity(mContext, StockActivity.class);
                break;
        }
    }



}